home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: Special XP & Vista
/
Chip Spesial XP & Vista.iso
/
3_Gadgets
/
gdAmp
/
gdamp.gg
/
title_anim.js
< prev
next >
Wrap
Text File
|
2007-08-14
|
894b
|
45 lines
/* gdAmp - Copyright (c) Aug 2007 Krzysztof Olczyk */
var isRight = false;
var speed = 5000;
var animH = null;
var toH = null;
function animateTitle()
{
var txtlen = dtbLbl.innerText.length
if (txtlen > 25)
{
dtbLbl.width = txtlen * 7;
speed = txtlen * 100;
if (isRight)
{
animH = beginAnimation("do_animateTitle()", -dtbLbl.width + dTitleBar.width, 0, speed);
isRight = false;
}
else
{
animH = beginAnimation("do_animateTitle()", 0, -dtbLbl.width + dTitleBar.width, speed);
isRight = true;
}
}
toH = setTimeout("animateTitle()", speed * 1.1);
}
function do_animateTitle()
{
caption = dtbLbl.innerText.substring(Math.round(-event.value / 4));
dtbLbl.x = event.value;
}
function resetAnimTitle()
{
if (animH)
cancelAnimation(animH);
if (toH)
clearTimeout(toH);
isRight = false;
dtbLbl.x = 0;
}